]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-texture-cache: Obey cache policy in st_texture_cache_load
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 4 Nov 2011 20:03:33 +0000 (16:03 -0400)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 13 Jul 2018 20:50:08 +0000 (20:50 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=663461

src/st/st-texture-cache.c
src/st/st-theme-node-drawing.c

index 0c794a3abdd716edc1d6e026ac9abe6d8e3576d7..3bf3a5e97b5311bd8b4bd1fa23ac8dd147decea0 100644 (file)
@@ -780,13 +780,13 @@ st_texture_cache_load (StTextureCache       *cache,
   if (!texture)
     {
       texture = load (cache, key, data, error);
-      if (texture)
+      if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
         g_hash_table_insert (cache->priv->keyed_cache, g_strdup (key), texture);
-      else
-        return NULL;
     }
 
-  cogl_object_ref (texture);
+  if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
+    cogl_object_ref (texture);
+
   return texture;
 }
 
index 8942966bfff929c7c487eeea4be42edcd772c1be..2123cc4872805c0c28c46c0ef54dbfc435351d41 100644 (file)
@@ -402,7 +402,7 @@ st_theme_node_lookup_corner (StThemeNode    *node,
     return COGL_INVALID_HANDLE;
 
   key = corner_to_string (&corner);
-  texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_NONE, load_corner, &corner, NULL);
+  texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_FOREVER, load_corner, &corner, NULL);
 
   if (texture)
     {